<meta charset="UTF-8">
<form id="myForm">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
				<h3 class="modal-title">用户管理</h3>
			</div>
			<div class="modal-body" style="height: 500px;width: 500px;padding-left: 80px;">
				 	<input type="hidden" name ="id" data-th-value="${model.id}" />
				 	<div class="form-group">
						<label class="col-sm-2 control-label">账号</label>
					 	<div class="col-sm-10">
							<input type="text" name="username" id="username" class="form-control"placeholder="请输入账户名" data-th-value="${model.username}"/>
					 	</div>
				 	</div>
				 	<br><br>
				 	<div class="form-group">
						<label class="col-sm-2 control-label">密码</label>
					 	<div class="col-sm-10">
							<input type="text" name="password" id="password" class="form-control" placeholder="请输入密码" data-th-value="${model.password}"/>
					 	</div>
				 	</div>
				 	<br><br>
				 	<div class="form-group">
						<label class="col-sm-2 control-label">性别</label>
					 	<div class="col-sm-10">
							<input type="text" name="sex" id="sex" class="form-control" placeholder="请输入性别" data-th-value="${model.sex}"/>
					 	</div>
				 	</div>
				 	<br><br>
				 	<div class="form-group">
						<label class="col-sm-2 control-label">年龄</label>
					 	<div class="col-sm-10">
							<input type="text" name="age" id="age" class="form-control" placeholder="请输入年龄" data-th-value="${model.age}" />
					 	</div>
				 	</div>
				 	<br><br>
				 	<div class="form-group">
						<label class="col-sm-2 control-label">民族</label>
					 	<div class="col-sm-10">
							<input type="text" name="nation" id="nation" class="form-control" placeholder="请输入民族" data-th-value="${model.nation}"/>
					 	</div>
				 	</div>
				 	<br><br>
				 	<div class="form-group">
						<label class="col-sm-2 control-label">住址</label>
					 	<div class="col-sm-10">
							<input type="text" name="address" id="address" class="form-control" placeholder="请输入住址" data-th-value="${model.address}"/>
					 	</div>
				 	</div>
				 	<br><br>
				 	<div class="form-group">
						<label class="col-sm-2 control-label">电话</label>
					 	<div class="col-sm-10">
							<input type="text" name="phone" id="phone" class="form-control" placeholder="请输入电话" data-th-value="${model.phone}"/>
					 	</div>
				 	</div>
			</div>
			<div class="modal-footer">
				<button type="submit" class="btn btn-primary"  id="g_formButton">
					<span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>提交
				</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">
					<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>重置
				</button>
			</div>
	</div>
</div>
</form>

<script>
	$(function(){
		$('#g_formButton').click(function(){
			var serial= $("#myForm").serialize();
			$.ajax({
				url:'persion/save',
				type:'post',
				data:serial,
				success:function(data){
					$('#persion_table') .bootstrapTable('refresh');
					bootbox.alert('<h4>'+data.msg+'</h4>');
				}
			});
		});
	});
</script>